import { DownOutlined } from '@ant-design/icons';
import { Dropdown, Menu, Space } from 'antd';
import React from 'react';

const menu = () =>{
    const items = [
        { label: '菜单项一', key: 'item-1' }, // 菜单项务必填写 key
        { label: '菜单项二', key: 'item-2' },
        {
          label: '子菜单',
          key: 'submenu',
          children: [{ label: '子菜单项', key: 'submenu-item-1' }],
        },
      ];
      return <Menu items={items} />;
}

const App = () => (
  <Dropdown overlay={menu} trigger={['click']}>
    
      <Space>
        Hover me
        <DownOutlined />
      </Space>
    
  </Dropdown>
);

export default App;